<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>

<link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<link href="data:text/css;charset=utf-8," data-href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet">
<link href="source/plugin/singcere_poll/template/video-js/video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->

<h5 class="poll-title">视频:</h5>

 <a type="list" href="javascript:" data-toggle="modal" data-target=".bs-example-modal-xm"  video="{$value1['videourl']}" image="{if !empty($pics)}{PRE_PATH}$pics[attachment].thumb.jpg{else}source/plugin/singcere_poll/template/src/img/img-default.jpg{/if}  " style="height:115px;overflow:hidden;}">
     <img class="pimg" src="source/plugin/singcere_poll/template/src/img/img-default.jpg" alt="$types[$key][name]">                                 
			<span class="z-video"><img src="/static/image/diy/c-videoimg.png" /></span>

</a>


<div class="poll-gushi">
    <video  id="js_video" class="video-js vjs-default-skin"  src="http://iokbl2.social-touch.com/static/ocenas.mp4"  controls preload="none" width="200"  height="400"      poster="{$pre}{$value[attachment]}" ></video>
</div>
<script>
    (function($){
        $('#js_video').click( function (){
            clearInterval(this.timer);
            this.timer = setTimeout(function (){
                window.full();
            },30)
        });

    })(jQuery)
    var fullscreen = function(elem) {
        var prefix = 'webkit';
        if ( elem[prefix + 'EnterFullScreen'] ) {
            return prefix + 'EnterFullScreen';
        } else if( elem[prefix + 'RequestFullScreen'] ) {
            return prefix + 'RequestFullScreen';
        };
        return false;
    };
    function autoFullScrenn(v){
        var ua   = navigator.userAgent.toLowerCase();
        var Android = String(ua.match(/android/i)) == "android";
        // if(!Android) return;//非android系统不使用;
        var video  = v,doc = document;
        var fullscreenvideo = fullscreen(doc.createElement("video"));
        if(!fullscreen) {
            alert("不支持全屏模式");
            return;
        }
        video.addEventListener("webkitfullscreenchange",function(e){
            if(!doc.webkitIsFullScreen){//退出全屏暂停视频
                this.pause();
            };
        }, false);
        video.addEventListener("click", function(){
            this.play();
            video[fullscreenvideo]();
        }, false);
        window.full = function (){
            video.play();
            video[fullscreenvideo]();
        }
        video.addEventListener('ended',function(){
            doc.webkitCancelFullScreen(); //播放完毕自动退出全屏
        },false);

    };
    var v = document.getElementById('js_video');
    autoFullScrenn(v);


</script>



</body>
</html>